﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace Fjaspx.UI.Web
{
    public class NewsBasePage : AdminPage
    {
        /// <summary>
        ///附件数据暂存在临时文件 成功后转移到相应目录  Shears the file.
        /// </summary>
        void ShearFile()
        {
            //try
            //{
            //    string oldFile = Server.MapPath("~/app_data/Appendix/temp/" + this.ClassKind + "/" + this.GUID + ".xml");
            //    string newFile = Server.MapPath("~/app_data/Appendix/" + this.ClassKind + "/" + this.GUID + ".xml");
            //    string newFilePath = Server.MapPath("~/app_data/Appendix/" + this.ClassKind + "/");
            //    string oldDir = Server.MapPath("~/App_Appendix/temp/" + this.ClassKind + "/" + this.GUID + "/");
            //    string newDir = Server.MapPath("~/App_Appendix/" + this.ClassKind + "/" + this.GUID + "/");
            //    string newDirPath = Server.MapPath("~/App_Appendix/" + this.ClassKind + "/");

            //    if (Directory.Exists(newFilePath) && Directory.Exists(newDirPath))//判断是否存在
            //    {
            //        File.Move(oldFile, newFile);
            //        Directory.Move(oldDir, newDir);
            //    }
            //    else
            //    {
            //        Directory.CreateDirectory(newFilePath);//创建新路径 
            //        Directory.CreateDirectory(newDirPath);//创建新路径 
            //        File.Move(oldFile, newFile);
            //        Directory.Move(oldDir, newDir);
            //    }

            //}
            //catch
            //{
            //    Response.Write("信息发布成功！文件上传失败！");
            //}
        }
    }
}
